package com.naizhuai.ui.rank.multType;

import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.naizhuai.R;
import com.naizhuai.ui.rank.ActiveBean;
import com.naizhuai.ui.rank.UserActiveAdapter;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import me.drakeet.multitype.ItemViewBinder;

/**
 * @author：lichenxi
 * @date 2018/5/17 11
 * email：525603977@qq.com
 * Fighting
 */
public class ActionDistributeViewBinder extends ItemViewBinder<ActionDistribute, ActionDistributeViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_action_distribute, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull ActionDistribute actionDistribute) {
        ArrayList<ActiveBean> list=new ArrayList<>();
        list.add(new ActiveBean("效率","100","40"));
        list.add(new ActiveBean("质量","100","15"));
        list.add(new ActiveBean("成本","100","10"));
        list.add(new ActiveBean("交期","100","5"));
        list.add(new ActiveBean("安全","100","2"));
        list.add(new ActiveBean("士气","100","3"));
        list.add(new ActiveBean("规范","100","15"));
        list.add(new ActiveBean("体验","100","10"));
        holder.activeDistribute.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext()));
        holder.activeDistribute.setAdapter(new UserActiveAdapter(list));
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.active_distribute)
        RecyclerView activeDistribute;
        ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
